#-------------------------------------------------------------------------------
#	file Makefile
#	brief
#
#	$Id: Makefile 261 2014-04-10 23:25:52Z ac.verbeck@gmail.com $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#	Copyright and Disclaimer Notice
#
#	Copyright (c) 2013-2014 A.C. Verbeck
#
#	This file is part of Shruthi Patch Reader (SPR)
#
#	Shruthi Patch Reader (SPR) is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation, either version 3 of the License, or
#	(at your option) any later version.
#
#	Shruthi Patch Reader (SPR) is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with Shruthi Patch Reader (SPR).
#	If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#	Environment
#-------------------------------------------------------------------------------
CC			= g++
WINDRES		= windres
CPPFLAGS	= -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -O2 -fno-strict-aliasing
LDLIBS		= -lpopt -mwindows -mthreads -lwx_mswu_core-3.0 -lwx_baseu-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lwxpng-3.0 -lwxregexu-3.0 -lwxexpat-3.0 -mthreads -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32

#-------------------------------------------------------------------------------
#	Build environment
#-------------------------------------------------------------------------------
BLD_TARGET	= bi
BLD_VERSION	= 1.00

#-------------------------------------------------------------------------------
#	Targets
#-------------------------------------------------------------------------------
TARGET		= minimal

#-------------------------------------------------------------------------------
#	Object files
#-------------------------------------------------------------------------------
OBJS_BI		= bi.o
OBJS_TARGET	= minimal.o minimal_rc.o

#-------------------------------------------------------------------------------
#	Rules
#-------------------------------------------------------------------------------
.PHONY:	all clean format
all:		$(TARGET)

clean:;		$(RM) *.o
			$(RM) *.bak
			$(RM) *.exe
			$(RM) *.cpp.orig
			$(RM) *.h.orig

format:;	astyle --pad-header --unpad-paren --style="k&r" --indent=tab --lineend=windows --recursive "*.cpp" "*.h"

#-------------------------------------------------------------------------------
#	Dependencies
#-------------------------------------------------------------------------------
bldinfo:;		$(RM) bi.cpp bi.h

bi.cpp:;		bldinfo --cpp --output=$(BLD_TARGET) --project=$(TARGET) --version=$(BLD_VERSION)		

minimal_rc.o:	sample.rc
				$(WINDRES) --input=$< --output=$@ --define __WXMSW__ -I /mingw/include/wx-3.0

minimal.cpp:	bi.cpp

minimal.o:		minimal.cpp
				$(CC) -c -o $@ $(CPPFLAGS) -D__WXMSW__ -DWXUSINGDLL -DWX_PRECOMP minimal.cpp -I /mingw/include/wx-3.0 -I /MinGW/lib/wx/include/msw-unicode-3.0

$(TARGET):		$(OBJS_BI) $(OBJS_TARGET)

#
#	End: Makefile
#
